#include<bits/stdc++.h>
using namespace std;
int main(){
	int a=(rand()%88)+11,  b=(rand()%88)+11,  ans,  i=0,   temp,   point=0;
	ofstream fout("Maths.txt",ios::out|ios::app|ios::binary);    //练习记录输出到该文件
	int ifollow =0;
	
	
	while(i<10){
		srand(time(0));
		a=(rand()%88)+11;
		b=(rand()%88)+11;
		if(a>b){
			
			if((a%10<b%10)&&(a-(a%10))>=(b-(b%10))){
				cout<<a<<"-"<<b<<"=";
				cin>>ans;
				if(ans==a-b){
					cout<<" "<<"Yes"<<" "<<"标答："<<a-b;
					cout<<endl;
					i++;
				}else{
					cout<<" "<<"No"<<" "<<"标答"<<a-b;
					cout<<endl;
					i++;
					point++;
				}
			}else{
				if((a%10<b%10)&&(a-(a%10))<=(b-(b%10))){
					for(int c=(b-(b%10))/10;c>=a-3;c--){
						b-=10;
					}
					cout<<a<<"-"<<b<<"=";
					cin>>ans;
					if(ans==a-b){
						cout<<" "<<"Yes"<<" "<<"标答："<<a-b;
						cout<<endl;
						i++;
					}else{
						cout<<" "<<"No"<<" "<<"标答"<<a-b;
						cout<<endl;
						i++;
						point++;
					}
				}else{
					if((a%10>b%10)&&(a-(a%10))>=(b-(b%10))){
						temp=b%10;
						b=b-(b%10)+a%10;
						a=a-(a%10)+temp;
						if(b>a){
							b-=10;
						} 
						cout<<a<<"-"<<b<<"=";
						cin>>ans;
						if(ans==a-b){
							cout<<" "<<"Yes"<<" "<<"标答："<<a-b;
							cout<<endl;
							i++;
						}else{
							cout<<" "<<"No"<<" "<<"标答"<<a-b;
							cout<<endl;
							i++;
							point++;
						}
					}else{
						for(int c=(b-(b%10))/10;c>=a-3;c--){
							b-=10;
						}
						temp=b%10;
						b=b-(b%10)+a%10;
						a=a-(a%10)+temp;
						if(b>a){
							b-=10;
						}
						cout<<a<<"-"<<b<<"=";
						cin>>ans;
						if(ans==a-b){
							cout<<" "<<"Yes"<<" "<<"标答："<<a-b;
							cout<<endl;
							i++;
						}else{
							cout<<" "<<"No"<<" "<<"标答"<<a-b;
							cout<<endl;
							i++;
							point++;
						}
					}
				}
			}
		}
		
		
		

		if (i == ifollow+1){  // 说明 i 增加了，有了一道新的题目，需要记录  
			ifollow = i;  //继续follow
			string chk;
			if (ans==a-b){chk ="Yes";
			}else{chk="No";
			}
			
			fout<<i<<". "<< a<<"-"<<b<<"= "<<ans<<"   "<<chk<<"  标答："<<a-b<<" \n"<<endl; 
		}
	

	}
	cout<<"总分："<<100-(5*point);
	
	fout<<"总分："<<100-(5*point);
	
	
	fout.close();

    
	return 0; 
}